const{
    callContainerApi, showSuccessToast
} = require("../../utils/util")
Page({
    data: {
        userInfo:null
    },
    onLoad() {
        this.isshow()
    },
     isshow(){
         callContainerApi(`/role/special`,"GET","")
        .then(res => {
            if(res.statusCode === 200){
                showSuccessToast("欢迎管理员登陆")
                const user = res.data.data.data
                this.setData({
                    userInfo:user
                })
            }
        })
    },
    viewOrderHistory() {
        wx.navigateTo({
            url: '/pages/orderList/orderList'
        });
    },
    manageAddress() {
        wx.navigateTo({
            url: '/pages/addressList/addressList'
        });
    },
    editUserInfo() {
        wx.navigateTo({
            url: '/pages/editUserInfo/editUserInfo'
        });
    },

    M_order_manage() {
        wx.navigateTo({
            url: `/pages/M_orderList/M_orderList?userInfo=${encodeURIComponent(JSON.stringify(this.data.userInfo))}` 
        });
    },

    M_goods_manage() {
        wx.navigateTo({
            url: `/pages/M_goods_manage/M_goods_manage?userInfo=${encodeURIComponent(JSON.stringify(this.data.userInfo))}`
        });
    }
});